# Copyright 2025 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Bazel dependencies for building Catch.
module(
    name = "catch",
    version = "1.0",
)

bazel_dep(name = "rules_android", version = "0.6.6")
bazel_dep(name = "rules_kotlin", version = "2.1.8")
bazel_dep(name = "rules_jvm_external", version = "6.7")
bazel_dep(name = "rules_robolectric", version = "4.16", repo_name = "robolectric")
bazel_dep(name = "rules_java", version = "9.0.3")
bazel_dep(name = "protobuf", version = "30.0")

# To avoid conflict with different protobuf versions.
single_version_override(
    module_name = "protobuf",
    version = "30.0",
)

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")

# Need to set testonly = True because the package depends on testonly targets.
maven.artifact(
    testonly = True,
    artifact = "runner",
    group = "androidx.test",
    version = "1.7.0",
)
maven.artifact(
    testonly = True,
    artifact = "junit",
    group = "androidx.test.ext",
    version = "1.3.0",
)
maven.artifact(
    testonly = True,
    artifact = "mockito-kotlin",
    group = "org.mockito.kotlin",
    version = "6.1.0",
)
maven.install(
    artifacts = [
        "androidx.test.ext:junit:1.3.0",
        "androidx.test:runner:1.7.0",
        "com.google.guava:guava:32.0.1-jre",
        "com.google.truth:truth:1.4.0",
        "org.mockito.kotlin:mockito-kotlin:6.1.0",
        "org.mockito:mockito-core:5.20.0",
        "org.robolectric:robolectric:4.16",
        "org.yaml:snakeyaml:2.5",
    ],
    repositories = [
        "https://maven.google.com",
        "https://repo1.maven.org/maven2",
    ],
)
use_repo(maven, "maven")

remote_android_extensions = use_extension(
    "@rules_android//bzlmod_extensions:android_extensions.bzl",
    "remote_android_tools_extensions",
)
use_repo(remote_android_extensions, "android_tools")

android_sdk_repository_extension = use_extension("@rules_android//rules/android_sdk_repository:rule.bzl", "android_sdk_repository_extension")
use_repo(android_sdk_repository_extension, "androidsdk")
